/**
 * @: 切换的状态
 */
export type SchedulingStatus = '未排产' | '已排产' | '生产中' | '已完成' | '已终止';

/**
 * 分页查询排程运算列表请求参数类型
 */
export interface SchedulePageParams extends PageCommonParams {
    orderNumber: string;
    itemCode: string;
    itemName: string;
    customerName: string;
    orderDateStart: string;
    orderDateEnd: string;
    orderStatus: string;
    creator: string;
    orderDeliveryDateStart: string;
    orderDeliveryDateEnd: string;
    createTimeStart: string;
    createTimeEnd: string;
    schedulingStatus?: SchedulingStatus;
}

/**
 * 分页查询排程运算列表请求参数类型
 */
export interface SchedulePageResponse extends ResponseListCommon<ScheduleListListInfo> {}

type Label = '计划延迟' | '实际延迟' | '插单';
// 排程列表类型
export interface ScheduleListListInfo {
    id: number;
    labels: Label[];
    orderNumber: string;
    materialName: string;
    itemCode: string;
    itemName: string;
    manufacturingStrategy: 'MTS' | 'MTO';
    itemStock: number;
    customerCode: string;
    customerCompanyName: string;
    orderDate: string;
    orderDeliveryDate: string;
    orderQuantity: number;
    plannedQuantity: number;
    completedQuantity: number;
    unfinishedQuantity: number;
    schedulingStatus: string;
    plannedStartTime: string;
    plannedEndTime: string;
    orderProgress: number;
    orderPriority: number;
    planExtension: number;
    actualCompletionTime: string;
    realityExtension: number;
    isWaitArrange: boolean;
    hasBom: boolean;
    hasProcess: boolean;
}

// 计划运算所需数据
export interface PlaningOperationParams {
    orderNumber: (string | number)[];
    planningOperationType: string;
    firstOrder?: boolean;
    synDeleteOrder?: boolean;
    confirmDeletePurchasePlan?: boolean;
}

// 计划运算进度条
export interface OperationProgressResponse {
    id: number;
    rate: number;
    status: number;
    orderIds: string;
    createTime: string;
    creator: string;
    failureReason: string;
}

// 排程基础参数
export interface PlanningOperationParamResponse {
    schedulingEndTime: string;
    schedulingStartTime: string;
    id: number;
}

// 计划时间
export interface PlanningData {
    id: number;
    schedulingStartTime?: string;
    schedulingEndTime?: string;
    settingsForSchedulingType: '排程开始时间' | '排程结束时间';
}

// 编辑订单参数
export interface OrderUpdate {
    orderNumber: string;
    itemCode: string;
    customerCode: string;
    orderDate: string;
    orderDeliveryDate: string;
    orderQuantity: string;
    orderPriority: string;
}
